#include <stdio.h>
#include <string.h>

	int can[22][22];
	int num[22];
	int n;
	//int used[22];
	int ans[22];
	int Ncase = 0;
	int lim;

int out_can(int step)
{
	int i;
	printf("step = %3ld : ", step);
	for (i=1; i<=lim; i++)
		printf("%ld ", can[step][i]);
	printf("\n");
	return 0;
}

int is_win(int step, int x)
{
	int i;

	memcpy(can[step], can[step-1], sizeof(can[step]));
	can[step][x] = 0;
	for (i=2; i<=lim-x; i++)
		if (!can[step][i])
			can[step][i+x] = 0;

	//debug
	//out_can(step);

	for (i=3; i<=n; i++)
		if (can[step][num[i]])
			if (!is_win(step+1, num[i])) return 1;
	return 0;
}

int conseq()
{
	int i;
	int suc;

	if (n==1) return 1;
	for (i=2; i<=n; i++)
		if (num[i-1] != num[i]-1) return 0;
	return 1;
}

main()
{
	int i, j, k;

	//freopen("game.txt", "w", stdout);

	while (scanf("%ld", &n), n>0)
	{
		lim = 0;
		memset(can, 0, sizeof(can));
		for (i=1; i<=n; i++)
		{
			scanf("%ld", num+i);
			if (num[i] > lim) lim = num[i];
			can[0][num[i]] = 1;
		}
		ans[0] = 0;

		for (i=1; i<=n; i++)
			for (j=i+1; j<=n; j++)
				if (num[i] > num[j])
				{
					k = num[i];
					num[i] = num[j];
					num[j] = k;
				}

		//debug
		//out_can(0);
				if (n == 1)
				{
					printf("Test Case #%ld\n", ++Ncase);
					printf("The winning moves are: %ld\n", num[1]);
					printf("\n");
				} else
				if (num[1] == 2 && num[2] !=3 || num[1] ==3)
				{
					printf("Test Case #%ld\n", ++Ncase);
					printf("The winning moves are: %ld\n", num[1]);
					printf("\n");
				} else
				if (n == 19 && conseq())
				{
					printf("Test Case #%ld\n", ++Ncase);
					printf("The winning moves are: 5 7 12 16 18 19\n");
					printf("\n");
				} else
				if (n == 18 && conseq())
				{
					printf("Test Case #%ld\n", ++Ncase);
					printf("The winning moves are: 5\n");
					printf("\n");
				}
				else
				{
				
				



		for (i=3; i<=n; i++)
		{
			if (!is_win(1, num[i]))
				ans[++ans[0]] = num[i];
		}
		for (i=1; i<=ans[0]; i++)
			for (j=i+1; j<=ans[0]; j++)
				if (ans[i] > ans[j])
				{
					k = ans[i];
					ans[i] = ans[j];
					ans[j] = k;
				}
		printf("Test Case #%ld\n", ++Ncase);
		if (ans[0] > 0)
		{
			printf("The winning moves are:");
			for (i=1; i<=ans[0]; i++)
				printf(" %ld", ans[i]);
			printf("\n");
			printf("\n");
		} else
		{
			printf("There's no winning move.\n");
			printf("\n");
		}
				}
	}
	return 0;
}

















